Optimal. Leaf size=383 \[ \frac{i b e^{i c} f^2 (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{-i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )}{2 g^3 n}+\frac{i b e^{i c} (f+g x)^3 \left (-i d (f+g x)^n\right )^{-3/n} \text{Gamma}\left (\frac{3}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{i c} f (f+g x)^2 \left (-i d (f+g x)^n\right )^{-2/n} \text{Gamma}\left (\frac{2}{n},-i d (f+g x)^n\right )}{g^3 n}+\frac{i b e^{-i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \text{Gamma}\left (\frac{2}{n},i d (f+g x)^n\right )}{g^3 n}-\frac{i b e^{-i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \text{Gamma}\left (\frac{3}{n},i d (f+g x)^n\right )}{2 g^3 n}+\frac{a x^3}{3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.344696, antiderivative size = 383, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 6, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {14, 3433, 3365, 2208, 3423, 2218} \[ \frac{i b e^{i c} f^2 (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{-i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )}{2 g^3 n}+\frac{i b e^{i c} (f+g x)^3 \left (-i d (f+g x)^n\right )^{-3/n} \text{Gamma}\left (\frac{3}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{i c} f (f+g x)^2 \left (-i d (f+g x)^n\right )^{-2/n} \text{Gamma}\left (\frac{2}{n},-i d (f+g x)^n\right )}{g^3 n}+\frac{i b e^{-i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \text{Gamma}\left (\frac{2}{n},i d (f+g x)^n\right )}{g^3 n}-\frac{i b e^{-i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \text{Gamma}\left (\frac{3}{n},i d (f+g x)^n\right )}{2 g^3 n}+\frac{a x^3}{3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 3433
Rule 3365
Rule 2208
Rule 3423
Rule 2218
Rubi steps
\begin{align*} \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right ) \, dx &=\int \left (a x^2+b x^2 \sin \left (c+d (f+g x)^n\right )\right ) \, dx\\ &=\frac{a x^3}{3}+b \int x^2 \sin \left (c+d (f+g x)^n\right ) \, dx\\ &=\frac{a x^3}{3}+\frac{b \operatorname{Subst}\left (\int \left (f^2 \sin \left (c+d x^n\right )-2 f x \sin \left (c+d x^n\right )+x^2 \sin \left (c+d x^n\right )\right ) \, dx,x,f+g x\right )}{g^3}\\ &=\frac{a x^3}{3}+\frac{b \operatorname{Subst}\left (\int x^2 \sin \left (c+d x^n\right ) \, dx,x,f+g x\right )}{g^3}-\frac{(2 b f) \operatorname{Subst}\left (\int x \sin \left (c+d x^n\right ) \, dx,x,f+g x\right )}{g^3}+\frac{\left (b f^2\right ) \operatorname{Subst}\left (\int \sin \left (c+d x^n\right ) \, dx,x,f+g x\right )}{g^3}\\ &=\frac{a x^3}{3}+\frac{(i b) \operatorname{Subst}\left (\int e^{-i c-i d x^n} x^2 \, dx,x,f+g x\right )}{2 g^3}-\frac{(i b) \operatorname{Subst}\left (\int e^{i c+i d x^n} x^2 \, dx,x,f+g x\right )}{2 g^3}-\frac{(i b f) \operatorname{Subst}\left (\int e^{-i c-i d x^n} x \, dx,x,f+g x\right )}{g^3}+\frac{(i b f) \operatorname{Subst}\left (\int e^{i c+i d x^n} x \, dx,x,f+g x\right )}{g^3}+\frac{\left (i b f^2\right ) \operatorname{Subst}\left (\int e^{-i c-i d x^n} \, dx,x,f+g x\right )}{2 g^3}-\frac{\left (i b f^2\right ) \operatorname{Subst}\left (\int e^{i c+i d x^n} \, dx,x,f+g x\right )}{2 g^3}\\ &=\frac{a x^3}{3}+\frac{i b e^{i c} f^2 (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{-i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{i c} f (f+g x)^2 \left (-i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac{2}{n},-i d (f+g x)^n\right )}{g^3 n}+\frac{i b e^{-i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac{2}{n},i d (f+g x)^n\right )}{g^3 n}+\frac{i b e^{i c} (f+g x)^3 \left (-i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac{3}{n},-i d (f+g x)^n\right )}{2 g^3 n}-\frac{i b e^{-i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac{3}{n},i d (f+g x)^n\right )}{2 g^3 n}\\ \end{align*}
Mathematica [A] time = 12.5848, size = 403, normalized size = 1.05 \[ \frac{a x^3}{3}+\frac{i b (\cos (c)-i \sin (c)) (f+g x) \left (d^2 (f+g x)^{2 n}\right )^{-3/n} \left (f^2 (\cos (c)+i \sin (c))^2 \left (i d (f+g x)^n\right )^{3/n} \left (-i d (f+g x)^n\right )^{2/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )-(f+g x) \left (2 f (\cos (c)+i \sin (c))^2 \left (i d (f+g x)^n\right )^{3/n} \left (-i d (f+g x)^n\right )^{\frac{1}{n}} \text{Gamma}\left (\frac{2}{n},-i d (f+g x)^n\right )-(f+g x) \left ((\cos (c)+i \sin (c))^2 \left (i d (f+g x)^n\right )^{3/n} \text{Gamma}\left (\frac{3}{n},-i d (f+g x)^n\right )-\left (-i d (f+g x)^n\right )^{3/n} \text{Gamma}\left (\frac{3}{n},i d (f+g x)^n\right )\right )-2 f \left (i d (f+g x)^n\right )^{\frac{1}{n}} \left (-i d (f+g x)^n\right )^{3/n} \text{Gamma}\left (\frac{2}{n},i d (f+g x)^n\right )\right )-f^2 \left (i d (f+g x)^n\right )^{2/n} \left (-i d (f+g x)^n\right )^{3/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )\right )}{2 g^3 n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.118, size = 0, normalized size = 0. \begin{align*} \int{x}^{2} \left ( a+b\sin \left ( c+d \left ( gx+f \right ) ^{n} \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{3} \, a x^{3} + b \int x^{2} \sin \left ({\left (g x + f\right )}^{n} d + c\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (b x^{2} \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a x^{2}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \left (a + b \sin{\left (c + d \left (f + g x\right )^{n} \right )}\right )\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a\right )} x^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]